package chatserver.netio;


import chatserver.tools.ChatException;
import java.io.*;

public class Command extends Message {

    public Command(byte byte0) {
        super(byte0);
    }

    public Command(byte byte0, AttrList attrlist) {
        super(byte0, attrlist);
    }

    public Command(InputStream inputstream)
            throws ChatException, IOException {
        super(inputstream);
    }

    public Command(Reader reader)
            throws ChatException, IOException {
        super(names, reader);
    }

    @Override
    protected Attr getAttrProto() {
        return proto;
    }

    @Override
    public Object clone() {
        return new Command(getId(), (AttrList) getParams().clone());
    }

    @Override
    public String getName() {
        return getName(names);
    }

    public static byte getId(String s) {
        for (byte byte0 = 0; byte0 < names.length; byte0++) {
            if (s.equalsIgnoreCase(names[byte0])) {
                return byte0;
            }
        }

        return -1;
    }

    public static String getName(byte byte0) {
        return byte0 >= names.length ? Integer.toString(byte0) : names[byte0];
    }

    @Override
    public String toString() {
        return super.toString("Command ", names);
    }
    private static final Attr proto = ClientAttr.getProto();
    public static final byte NUL = 0;
    public static final byte ADDEDCHATTER = 1;
    public static final byte KILLEDCHATTER = 2;
    public static final byte ADDEDCHANNEL = 3;
    public static final byte KILLEDCHANNEL = 4;
    public static final byte NOTE = 5;
    public static final byte NICKLIST = 6;
    public static final byte CHANNELLIST = 7;
    public static final byte JOINED = 8;
    public static final byte PARTED = 9;
    public static final byte USERINFO = 10;
    public static final byte BANLIST = 11;
    public static final byte E12 = 12;
    public static final byte VARIABLE = 13;
    public static final byte PERMS = 14;
    public static final byte CHANNELINFO = 15;
    public static final byte NOTSIGNEDUP = 16;
    public static final byte ISSIGNEDUP = 17;
    public static final byte NICKINUSE = 18;
    public static final byte NICKRESERVED = 19;
    public static final byte BANNEDONSERVER = 20;
    public static final byte BANNEDONCHANNEL = 21;
    public static final byte NOPERMISSION = 22;
    public static final byte FLOODING = 23;
    public static final byte QUEUEPOSITION = 24;
    public static final byte QUEUEUPDATE = 25;
    public static final byte KILLED = 26;
    public static final byte BANNED = 27;
    public static final byte UNBANNED = 28;
    public static final byte GAVEPERMS = 29;
    public static final byte TOOKPERMS = 30;
    public static final byte ENQUEUED = 31;
    public static final byte DEQUEUED = 32;
    public static final byte FOUNDNICKS = 33;
    public static final byte MEMBERINFO = 34;
    public static final byte PROXYLIST = 35;
    public static final byte NOTARGET = 36;
    public static final byte TOOMANYIPCXNS = 37;
    public static final byte NOCHANNEL = 38;
    public static final byte SETPROFILE = 39;
    public static final byte PROFILE = 40;
    public static final byte PROXYINFO = 41;
    public static final byte CHATBOXINFO = 42;
    public static final byte CHALLENGE = 43;
    public static final byte CHANNELFULL = 44;
    public static final byte DONE = 45;
    public static final byte FAILED = 46;
    public static final byte LOG = 47;
    public static final byte TRACKLIST = 48;
    public static final byte ADDEDTRACK = 49;
    public static final byte KILLEDTRACK = 50;
    public static final byte STARTEDTRACK = 51;
    public static final byte STOPPEDTRACK = 52;
    public static final byte ADDIGNORE = 53;
    public static final byte OPENPRIVATE = 54;    
    public static final byte REGMISSING = 55;
    public static final byte REGNAMEMATCH = 56;
    public static final byte REGNAMETAKEN = 57;
    public static final byte REGCREATED = 58;
    public static final byte REGWRONGEMAIL = 59;
    public static final byte REGPWCHANGED = 60; 
    public static final byte CHANGEDNICKNAME = 61;     
    public static final byte CHANGEDIGNORE = 62;
    public static final byte HIDEON = 63;
    public static final byte HIDEOFF = 64;    
    public static final byte MAX_ID = 64;
    public static final byte COLORUSE = 65;
    private static final String names[] = {
        "NUL", "ADDEDCHATTER", "KILLEDCHATTER", "ADDEDCHANNEL", "KILLEDCHANNEL", "NOTE", "NICKLIST", "CHANNELLIST", "JOINED", "PARTED",
        "USERINFO", "BANLIST", "12", "VARIABLE", "PERMS", "CHANNELINFO", "NOTSIGNEDUP", "ISSIGNEDUP", "NICKINUSE", "NICKRESERVED",
        "BANNEDONSERVER", "BANNEDONCHANNEL", "NOPERMISSION", "FLOODING", "QUEUEPOSITION", "QUEUEUPDATE", "KILLED", "BANNED", "UNBANNED", "GAVEPERMS",
        "TOOKPERMS", "ENQUEUED", "DEQUEUED", "FOUNDNICKS", "MEMBERINFO", "PROXYLIST", "NOTARGET", "TOOMANYIPCXNS", "NOCHANNEL", "SETPROFILE",
        "PROFILE", "PROXYINFO", "CHATBOXINFO", "CHALLENGE", "CHANNELFULL", "DONE", "FAILED", "LOG", "TRACKLIST", "ADDEDTRACK",
        "KILLEDTRACK", "STARTEDTRACK", "STOPPEDTRACK", "ADDIGNORE", "OPENPRIVATE",
        "REGMISSING", "REGNAMEMATCH", "REGNAMETAKEN", "REGCREATED", "REGWRONGEMAIL", "REGPWCHANGED", "CHANGEDNICKNAME", "CHANGEDIGNORE",
        "HIDEON", "HIDEOFF", "COLORUSE"
    };
}
